#ifndef _LOCATION_H_DACHI_
#define _LOCATION_H_DACHI_

#include <string>
#include <vector>
#include "../Util.h"
#include "../Characters/Character.h"
#include <fstream>


class Item;
struct neighbor;

class Location
{
	public:
		Location();
		~Location();
		
		std::string get_description();
		std::vector<neighbor> get_neighbors();
		std::vector<Item*> get_items();
		std::string get_name();

		void add_neighbor(std::string dir, Location* neighbor, progress p = NONE);
		void add_item(Item* new_item);
		void add_character(Character * character);
		void set_player(Character * player);

		void set_visited(bool visited);
		bool is_visited();
		friend bool saveLocation (Location&, std::ofstream&, Character*);
		friend Location* loadLocation(Game &g, std::ifstream & input);
		
		Location* run();

	protected:
		void initialize(std::string name, std::string description); // to be run by the constructor
		Character * player;
		std::string loc_name;
		std::string loc_description;
		std::vector<neighbor> loc_neighbors;
		std::vector<Character*> loc_characters;
		std::vector<Item*> items;
		bool loc_visited;
		
		void remove_character(Character * character);
		void remove_item(Item * item);
		Location* start_battle(bool playerattack, Character *);
		std::vector<cmdalt> get_alternatives();
		
		void print_menu();
		Location* create_reaction(std::vector<std::string>);
		
		virtual bool sleep() = 0; // TODO remove... this should be abstract and this method forces it... we should really make it abstract fo real
};

struct neighbor
{
	std::string direction;
	Location* location;
	progress required;
};

#endif
